package com.gt.quality.system.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gt.quality.base.BaseCommonService;
import com.gt.quality.system.entity.SysMenu;
import com.gt.quality.system.entity.SysRole;
import com.gt.quality.system.entity.vo.TreeTableMenuVo;
import com.gt.quality.base.pojo.BaseLimitRequest;
import com.gt.quality.base.pojo.LayerListViewObject;

import java.util.List;

/**
 * 菜单权限表(SysMenu)表服务接口
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
public interface SysMenuService extends BaseCommonService<SysMenu> {

    /**
     * Description:  分页查询
     *
     * @param limitRequest 分页查询参数
     * @author: makeJava
     * @date: 2026-11-25 16:30:08
     * @return:com.baomidou.mybatisplus.core.metadata.IPage
     */
    @Override
    IPage<SysMenu> queryLimitPage(BaseLimitRequest<SysMenu> limitRequest);


    /**
     * Description:  批量新增
     *
     * @param entityList entityList
     * @author: makeJava
     * @date: 2026-11-25 16:30:08
     * @return:Integer
     */
    @Override
    Integer saveBatchByEasyBaseMapper(List<SysMenu> entityList);

    List<SysMenu> selectByRoleIds(List<SysRole> list);

    /**
     * 父级菜单树渲染
     */
    LayerListViewObject buildTreeDeptInfo(List<SysMenu> list, Long menuId);

    /**
     * 缓存菜单树查询
     */
    List<JSONObject> cacheTreeMenuQuery();

    /**
     * 菜单树--新增或者修改
     */
    boolean insertOrUpdate(TreeTableMenuVo sysMenu);

    List<SysMenu> listByLocalCache();
}


